package router

import (
	"net/http"

	"github.com/gin-gonic/gin"

	"message-center/handler/v1/demo"
)

func Load() *gin.Engine {
	g := gin.New()

	g.Use(gin.Logger())

	g.Use(gin.Recovery())

	g.NoRoute(func(c *gin.Context) {
		c.String(http.StatusNotFound, "The incorrect API route.")
	})

	// 示例demo
	d := g.Group("/api/v1/demo")
	{
		d.GET("/health", demo.HealthCheck)
		d.GET("/disk", demo.DiskCheck)
		d.GET("/cpu", demo.CPUCheck)
		d.GET("/ram", demo.RAMCheck)
	}

	return g
}
